﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Redboil.Bfp.Model;

namespace Redboil.Practices.Mvc3.Controllers {
    public class HomeController : Controller {
        public ActionResult Index() {
            return View();
            //Redboil.Bfp.Model.User user = new User();
            //return View(user);
        }

        public ActionResult Index(String name, int number = 1) {
            ViewBag.Message = "Hello" + name;
            ViewBag.Number = number;
            return View("Index");
        }

        public String ReturnStringSample() {
            return "Welcome";
        }

        //在浏览器中输入“http://localhost:xxxx/HelloWorld/Welcome?name=Scott&numtimes=4”，浏览器自动将URL地址栏中的参数映射成Welcome方法中的传入参数。
        public String ReturnStringSample(String name, int number = 1) {
            return "Welcome";
        }
    }
}
